#ifndef TLC5940_H
#define TLC5940_H
// ---------------------------------------------------------------------------
// Core Arduino Libraries
#include "Arduino.h"
// Integer types
#include "stdint.h"
// ---------------------------------------------------------------------------
class cTLC5940
{
	public:
					cTLC5940( );
				   ~cTLC5940();
		
		void		me_Init();
		void		me_UpdateOutput();
		void		me_SetPin(uint8_t pin, boolean state);
		void		me_SetPins(uint16_t pins);
		void		me_SetPwm(uint16_t pwm);
		void		me_PwmTick( );
		
	private:	
		static const uint8_t NUMBER_OF_PINS = 16;
		static const uint8_t MAX_PWM = 100;
		
		uint8_t		at_Sin;
		uint8_t		at_Sclk;
		uint8_t		at_Xlat;
		uint8_t		at_Gsclk;
		uint8_t		at_Blank;
		uint8_t		at_Pwm;
		uint8_t		at_PwmCounter;
		
		boolean		at_Pins[NUMBER_OF_PINS];
		
		void		me_ClockData( );
		void		me_LatchData( );
};
// ---------------------------------------------------------------------------
#endif
